namespace StudentManagement.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class Student1 : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Branches",
                c => new
                    {
                        BranchId = c.Int(nullable: false, identity: true),
                        Name = c.String(nullable: false),
                        ShortName = c.String(nullable: false),
                        Description = c.String(),
                    })
                .PrimaryKey(t => t.BranchId);
            
            AddColumn("dbo.Students", "BranchId", c => c.Int(nullable: false));
            AddColumn("dbo.Students", "CourseId", c => c.Int(nullable: false));
            AddColumn("dbo.Students", "Gender", c => c.Boolean(nullable: false));
            AddColumn("dbo.Courses", "BranchId", c => c.Int(nullable: false));
            AlterColumn("dbo.Students", "Address", c => c.String());
            DropColumn("dbo.Students", "Course");
        }
        
        public override void Down()
        {
            AddColumn("dbo.Students", "Course", c => c.Int(nullable: false));
            AlterColumn("dbo.Students", "Address", c => c.String(nullable: false));
            DropColumn("dbo.Courses", "BranchId");
            DropColumn("dbo.Students", "Gender");
            DropColumn("dbo.Students", "CourseId");
            DropColumn("dbo.Students", "BranchId");
            DropTable("dbo.Branches");
        }
    }
}
